package com.beidasoft.web.model.enity;

import com.beidasoft.web.annotation.ESQuery;
import com.beidasoft.web.util.enums.ESOperator;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;


import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@Document(indexName = "zfjd_simple_case", replicas = 0)
//@ApiModel(value = "案件对象ES文档类")
public class SimpleCaseEntity {

    @Id
    @Field(store = true, type = FieldType.Text, index = false)
    //@ApiModelProperty(value = "主键")
    private String id;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "来源类型（1：执法；2：监督）")
    private Integer dataSource;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    //@ApiModelProperty(value = "案件名称")
    private String caseName;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    //@ApiModelProperty(value = "登记人姓名")
    private String registrant;



    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "是否删除（1：是；2：否）")
    private Integer isDelete;


    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "是否移动端（1：是；2：否）")
    private Integer isMobile;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "行政区划")
    private String departmentCode;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "所属部门")
    private String organizationId;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "所属部门名称")
    private String organizationName;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "所属主体")
    private String subjectId;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "所属主体名称")
    private String subjectName;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "内设机构")
    private String innerOrgId;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "内设机构名称")
    private String innerOrgName;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "创建日期")
    private Date createTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "提交日期")
    private Date submitTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "更新到ES时间")
    private Date updateTime;

    @Field(type = FieldType.Keyword)
    private List<PersonExtraEs> persons;   //执法人员

    @Field(type = FieldType.Keyword)
    private List<LitigantExtraEs> litigants;   //当事人



    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "案件立案日期")
    private Date filingDate;

    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "罚款金额")
    private String fineSum;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    //@ApiModelProperty(value = "处罚决定书文号")
    private String punishmentCode;


    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "处罚决定书日期")
    private Date punishmentTime;

    //@ApiModelProperty(value = "处罚决定书日期", hidden = true)
//    @ESQuery(operator = ESOperator.gte, keyword = "punishDate")
//    private Date punishmentTime;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    //@ApiModelProperty(value = "处罚事项")
    private String punishmentMatters;


    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "柔性执法")
    private Integer administraTion;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "案件结案日期")
    private Date closedDate;


    @Field(type = FieldType.Keyword)
    //@ApiModelProperty(value = "是否检查转处罚 0，否，1，是")
    private Integer isExecPunish;


    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone ="GMT+8")
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "uuuu-MM-dd")
    //@ApiModelProperty(value = "执法检查日期")
    private Date inspTime;







}
